<%@ page import="com.biz.utils.ConfigUtil" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
    String resoursUrl = ConfigUtil.get("RESOURCES_URL");
%>
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>收货地址</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="format-detection" content="telephone=no" />
<jsp:include page="/jsp/inc_head.jsp"></jsp:include>
<style>
.shdz_lie{
	padding:12px 10px;
	border-bottom:1px solid #eeeeee;
    box-shadow:0 5px 5px #f9f9f9;
	color:#000;
	font-size:14px;	
}
.mrdz_span{
	padding:2px 10px;
	background-color:#ff6060;
	color:#fff;
	border-radius:20px;	
	font-size:12px;
}
.shdz_addr{
	line-height:18px;	
}
.btm_create{
	background-color:#ffbe23;
	color:#fff;		
}
</style>
</head>

<body>
<div class="am-g">
	<c:choose>
		<c:when test="${not empty address_list}">
				<c:forEach items="${address_list}"  var="obj" varStatus="vs">
						<div class="am-u-sm-12 shdz_lie" onClick="toEditAddr('${obj.id}')">
					    	<div class="am-u-sm-11 am-pad-none">
					            <div class="am-u-sm-12 am-pad-none">
					                <div class="am-u-sm-3 am-pad-none">
					                    ${obj.name}
					                </div>
					                <div class="am-u-sm-9 am-pad-none">
					                    ${obj.phone}
					                </div>
					            </div>
					            <div class="am-u-sm-12 am-pad-none">
					                <div class="am-u-sm-3 am-pad-none">
					                	<c:if test="${obj.isdefault == 1 }">
				                        	<span class="mrdz_span">默认</span>
					                   </c:if>
					                   <c:if test="${obj.isdefault == 0 }">
					                        <span class="mrdz_span" style="display:none">默认</span>
					                   </c:if>
					                    
					                </div>
					                <div class="am-u-sm-9 am-pad-none shdz_addr">
					                    ${obj.proName}${obj.cityName}${obj.areaName}${obj.addDetail}
					                </div>
					            </div>
					        </div>
					        <div class="am-u-sm-1 am-pad-none am-text-right">
					        	<img src="<%=resoursUrl%>resources/assets/image/icon_right.png" style="margin-top:18px;" />
					        </div>
					    </div>
				</c:forEach>
        </c:when>
	</c:choose>
</div>

<div class="am-g btm_fixedsecond">
	<div class="am-u-sm-12 am-pad-none am-text-center">
    	<div class="am-u-sm-6 am-pad-none am-text-center btm_create">
        	<div onClick="addAddr()">新建收货地址</div>
        </div>
        <div class="am-us-m-6 am-pad-none am-text-center btm_save">
        	<div onClick="back()">返回</div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
var ajaxpath="${pageContext.request.contextPath}";

$(function() {
	//queryAddress();
});
//跳转编辑
function toEditAddr(id)
{
	var json ='${json}';
	location.href=ajaxpath+"/client_toEditAddress.do?id="+id+"&json="+json;
}
//跳转新增
function addAddr(){
	var json ='${json}';
	location.href=ajaxpath+"/client_toAddAddress.do?json="+json;
}
function back(){
	//window.history.go(-1);
	var json ='${json}';
	if(json!=null&&json!=undefined&&json!='')
	{ window.location.href=ajaxpath+"/order/toOrderConfirm2.do?json="+json;}
	else
	{ window.location.href=ajaxpath+"/client_toClientCenter.do";}
	
}
</script>
</html>
